
#使用python操作Excel

import xlrd

xlsx = xlrd.open_workbook("D:\\text ")
table = xlsx.sheet_by_index(0)

nrows = table.nrows

total = 0
count = 0

for i in range(1,nrows):
    classID = table.cell_value(i,1)
    if classID == 100:
        total += table.cell_value(i,2)
        count += 1

print(f'平均分={total/count}')

